angular.module('Controller')
.directive('wfGoState',($rootScope,menuManage)->
    return {
        restrict:'A'
#        scope:{wfGoState:'=wfGoState'}
        link: (scope, element, attr) ->
            element.bind 'click', (event) ->
                stateData = attr.wfGoState
                return if !stateData
                stateData=JSON.parse(stateData)
                if stateData.state=='contract-detail'
                    console.log('contract-detail')
                    $rootScope.pageType='contract-detail'
                    $rootScope.pageParams={contractId:stateData.contractId}
                    menuManage.goState('contract-detail',true)
    }
)